package com.example.paper.api;

import com.example.mvp.model.BaseEntity;
import com.example.paper.brean.ChannelBean;
import com.example.paper.brean.ImageBannerBean;
import com.example.paper.brean.LoginBean;
import com.example.paper.brean.NewsBean;
import com.example.paper.brean.ResultBean;
import com.example.paper.brean.TextBannerBean;
import com.example.paper.brean.UpLoadBean;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;


public interface Api {

    String BaseUrl = "http://118.195.161.134:8066/";
    String FileUrl = "http://118.195.161.134:8066/fileDownload?fileName=";

    //请求Token头
    @POST("sysToken/getToken")
    Observable<ResultBean> requestToken(@Body RequestBody body);

    //登录
    @POST("sysUser/loginUser")
    Observable<LoginBean> requestLogin(@Body RequestBody body);

    //注册
    @POST("sysUser/registerUser")
    Observable<LoginBean> requestReg(@Body RequestBody body);

    //上传头像
    @Multipart
    @POST("fileUpload")
    Observable<UpLoadBean> requestUpload(@Part List<MultipartBody.Part> image);

    //更新用户信息
    @POST("sysUser/updateUser")
    Observable<BaseEntity> requestUpdate(@Body RequestBody body);

    //新闻列表
    @POST("sysNews/channelNews")
    Observable<NewsBean> requestNews(@Body RequestBody body);

    //用户频道接口
    @POST("sysChannel/userChannel")
    Observable<ChannelBean> requestUserChannels(@Body RequestBody body);

    @POST("sysBanner/textBannerNews")
    Observable<TextBannerBean> requestTextBanner();

    @POST("sysBanner/bannerNews")
    Observable<ImageBannerBean> requestUserImageBanner();



}
